package com.bua.datafactory;

import com.bua.dao.DentistItem;
import org.json.JSONArray;
import org.json.JSONException;

/**
 * Created with IntelliJ IDEA.
 * User: ningning
 * Date: 13-7-2
 * Time: 下午10:53
 * To change this template use File | Settings | File Templates.
 */
public class DentistListDataFactory extends DataFactory {
    public DentistItem[] dentistItem;

    public DentistListDataFactory(String jsonString) {
        super(jsonString);
        if (status == 200) {
            try {
                JSONArray dentistArray = body.getJSONArray("dentistList");
                int size = dentistArray.length();
                dentistItem = new DentistItem[size];
                for (int index = 0; index < size; index++) {
                    DentistItem item=new DentistItem();
                    item.DentistId = dentistArray.getJSONObject(index).getString("DentistId");
                    item.DentistName = dentistArray.getJSONObject(index).getString("DentistName");
                    dentistItem[index]=item;
                }
            } catch (JSONException e) {

            }
            //dentistItem
        }

    }
}
